// 引入jQuery的CDN
import 'https://cdn.bootcdn.net/ajax/libs/jquery/2.2.0/jquery.js';
class Nb {
    constructor() {

    }
    init() {
        this.rdnom()
    }

    rdnom() {
        $.ajax({
            url: 'http://localhost/www.gome.com.cn/zkl/interface/getitems.php',
            dataType: 'json'
        }).then(function(resDate) {
            console.log(resDate);
            let str = '';
            $.each(resDate, function(i, v) {
                str += `
                  <li>
                      <a href="./commodity.html?sid=${v.sid}"><img src= ${v.url}>
                          <p class="jieshao">${v.title}</p>
                          <p class="money">￥${v.price}</p>
                      </a>
  
                  </li>
                      `
            })

            $('.bottom .cainixihuan').html(str);
        })

    }

}
export {
    Nb
}